package com.wzy.dao.user;

import com.wzy.entity.User;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface UserMapper {
    /**
     * 查询总共记录数
     * @return
     */
    int count();

    List<User> list();

    /**
     * 根据用户名查询用户
     * @param userName
     * @return
     */
    public List<User> getListByName(String userName);

    /**
     * 根据用户对象查询用户
     * @param user
     * @return
     */
    public List<User> getListByUser(User user);

    /**
     * 根据map查询用户
     * @param map
     * @return
     */
    public List<User> getListByMap(Map<String,Object> map);

    /**
     * 根据map查询用户
     * @param map
     * @return
     */
    public List<User> getListByMap2(Map<String,Object> map);

    public int add(User user);

    public int update(User user);

    public int updateTrim(User user);

    public int updatePwd(@Param("id") int id, @Param("password") String pwd);

    /**
     * 根据map查询用户
     * @param map
     * @return
     */
    public List<User> getListByMap3(Map<String,Object> map);

    public User getUserById(int id);

    public List<User> getListByUserNameAndRoleId(@Param("userName")String userName,@Param("userRole")Integer userRole);

    public List<User> getListByUserNameAndRoleId2(@Param("userName")String userName,@Param("userRole")Integer userRole);

    public List<User> getListByRoleId(int[] arrayRoleIds);

    public List<User> getListByRoleId2(List<Integer> listRoleIds);

    public List<User> getListByRoleId3(Map<String,Object> map);

    public List<User> getListByUserNameRoleId_choose(@Param("userName") String userName,@Param("userRole") Integer userRole);

    public List<User> getListPage(@Param("beginIndex") int beginIndex, @Param("pageSize") int pageSize);
}
